<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tinyOS: tMBox.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">tinyOS
   &#160;<span id="projectnumber">v1.00</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('t_m_box_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">tMBox.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="t_m_box_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#ifndef TMBOX_H</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#define TMBOX_H</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &quot;tConfig.h&quot;</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#if !defined(TINYOS_ENABLE_MBOX) || TINYOS_ENABLE_MBOX == 1</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="t_event_8h.html">tEvent.h</a>&quot;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="group___xE9_x82_xAE_xE7_xAE_xB1.html#gae98d38e0915738d565f697b203e667b1">   23</a></span>&#160;<span class="preprocessor">#define tMBOXSendNormal             0x00        </span></div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="group___xE9_x82_xAE_xE7_xAE_xB1.html#ga12536685a5e231dea9a6433c77c5491f">   24</a></span>&#160;<span class="preprocessor">#define tMBOXSendFront              0x01        </span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">// 邮箱类型</span></div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="struct__t_mbox.html">   27</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__t_mbox.html">_tMbox</a> {</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="struct__t_mbox.html#a8b516ab130f86e4b15ca025c98c3dc53">   28</a></span>&#160;    <a class="code" href="struct__t_event.html">tEvent</a> <a class="code" href="struct__t_mbox.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>;                               </div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="struct__t_mbox.html#a86988a65e0d3ece7990c032c159786d6">   30</a></span>&#160;    uint32_t <a class="code" href="struct__t_mbox.html#a86988a65e0d3ece7990c032c159786d6">count</a>;                             </div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="struct__t_mbox.html#a0a71cf941cf2509857d61e1443ad8eaa">   31</a></span>&#160;    uint32_t <a class="code" href="struct__t_mbox.html#a0a71cf941cf2509857d61e1443ad8eaa">read</a>;                              </div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="struct__t_mbox.html#ac4c9f9c5eac363cc22ecc18669cc3891">   32</a></span>&#160;    uint32_t <a class="code" href="struct__t_mbox.html#ac4c9f9c5eac363cc22ecc18669cc3891">write</a>;                             </div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="struct__t_mbox.html#a1cc8a4ba5eee24b560f9869012941e91">   33</a></span>&#160;    uint32_t <a class="code" href="struct__t_mbox.html#a1cc8a4ba5eee24b560f9869012941e91">maxCount</a>;                          </div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="struct__t_mbox.html#a42b4bab76140c12b77b72ec381001c6c">   35</a></span>&#160;    <span class="keywordtype">void</span> **<a class="code" href="struct__t_mbox.html#a42b4bab76140c12b77b72ec381001c6c">msgBuffer</a>;                           </div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;} <a class="code" href="group___xE9_x82_xAE_xE7_xAE_xB1.html#gaf02fc8927d941b8983e485f054dee3c8">tMbox</a>;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">// 邮箱状态类型</span></div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="struct__t_mbox_info.html">   39</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__t_mbox_info.html">_tMboxInfo</a> {</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="struct__t_mbox_info.html#a86988a65e0d3ece7990c032c159786d6">   40</a></span>&#160;    uint32_t <a class="code" href="struct__t_mbox_info.html#a86988a65e0d3ece7990c032c159786d6">count</a>;                             </div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="struct__t_mbox_info.html#a1cc8a4ba5eee24b560f9869012941e91">   41</a></span>&#160;    uint32_t <a class="code" href="struct__t_mbox_info.html#a1cc8a4ba5eee24b560f9869012941e91">maxCount</a>;                          </div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="struct__t_mbox_info.html#a80462c64b9184115aa568f08227f7f4a">   42</a></span>&#160;    uint32_t <a class="code" href="struct__t_mbox_info.html#a80462c64b9184115aa568f08227f7f4a">taskCount</a>;                         </div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;} <a class="code" href="group___xE9_x82_xAE_xE7_xAE_xB1.html#gace85309e5c44e993e993af3a8e1b00c2">tMboxInfo</a>;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE9_x82_xAE_xE7_xAE_xB1.html#gae6bb5e2c3b40c25946cd3783387ef53e">tMboxInit</a> (<a class="code" href="struct__t_mbox.html">tMbox</a> *mbox, <span class="keywordtype">void</span> **<a class="code" href="struct__t_mbox.html#a42b4bab76140c12b77b72ec381001c6c">msgBuffer</a>, uint32_t <a class="code" href="struct__t_mbox.html#a1cc8a4ba5eee24b560f9869012941e91">maxCount</a>);</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;uint32_t <a class="code" href="group___xE9_x82_xAE_xE7_xAE_xB1.html#ga23993f613e24cf58555aae3b7606722d">tMboxWait</a> (<a class="code" href="struct__t_mbox.html">tMbox</a> *mbox, <span class="keywordtype">void</span> **msg, uint32_t waitTicks);</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;uint32_t <a class="code" href="group___xE9_x82_xAE_xE7_xAE_xB1.html#ga24727b25fe713d402f2f3aa21d6ea98b">tMboxNoWaitGet</a> (<a class="code" href="struct__t_mbox.html">tMbox</a> *mbox, <span class="keywordtype">void</span> **msg);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;uint32_t <a class="code" href="group___xE9_x82_xAE_xE7_xAE_xB1.html#ga77710ad1a67a5bdfe7a918cfd3b1ae6a">tMboxNotify</a> (<a class="code" href="struct__t_mbox.html">tMbox</a> *mbox, <span class="keywordtype">void</span> *msg, uint32_t notifyOption);</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE9_x82_xAE_xE7_xAE_xB1.html#gaa37bb91261b5b19d6c7d72a88a52a457">tMboxFlush</a> (<a class="code" href="struct__t_mbox.html">tMbox</a> *mbox);</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;uint32_t <a class="code" href="group___xE9_x82_xAE_xE7_xAE_xB1.html#ga3473c47a3e47521c023738edf046252f">tMboxDestroy</a> (<a class="code" href="struct__t_mbox.html">tMbox</a> *mbox);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE9_x82_xAE_xE7_xAE_xB1.html#gae8b08f83ec686fdd556c12baaa3a4a48">tMboxGetInfo</a> (<a class="code" href="struct__t_mbox.html">tMbox</a> *mbox, <a class="code" href="struct__t_mbox_info.html">tMboxInfo</a> *info);</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor">#endif // TINYOS_ENABLE_MBOX</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* TMBOX_H */</span><span class="preprocessor"> </span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="ttc" id="struct__t_mbox_info_html_a80462c64b9184115aa568f08227f7f4a"><div class="ttname"><a href="struct__t_mbox_info.html#a80462c64b9184115aa568f08227f7f4a">_tMboxInfo::taskCount</a></div><div class="ttdeci">uint32_t taskCount</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8h_source.html#l00042">tMBox.h:42</a></div></div>
<div class="ttc" id="struct__t_mbox_html"><div class="ttname"><a href="struct__t_mbox.html">_tMbox</a></div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8h_source.html#l00027">tMBox.h:27</a></div></div>
<div class="ttc" id="group___xE9_x82_xAE_xE7_xAE_xB1_html_gae8b08f83ec686fdd556c12baaa3a4a48"><div class="ttname"><a href="group___xE9_x82_xAE_xE7_xAE_xB1.html#gae8b08f83ec686fdd556c12baaa3a4a48">tMboxGetInfo</a></div><div class="ttdeci">void tMboxGetInfo(tMbox *mbox, tMboxInfo *info)</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8c_source.html#l00192">tMBox.c:192</a></div></div>
<div class="ttc" id="struct__t_mbox_info_html_a1cc8a4ba5eee24b560f9869012941e91"><div class="ttname"><a href="struct__t_mbox_info.html#a1cc8a4ba5eee24b560f9869012941e91">_tMboxInfo::maxCount</a></div><div class="ttdeci">uint32_t maxCount</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8h_source.html#l00041">tMBox.h:41</a></div></div>
<div class="ttc" id="group___xE9_x82_xAE_xE7_xAE_xB1_html_ga77710ad1a67a5bdfe7a918cfd3b1ae6a"><div class="ttname"><a href="group___xE9_x82_xAE_xE7_xAE_xB1.html#ga77710ad1a67a5bdfe7a918cfd3b1ae6a">tMboxNotify</a></div><div class="ttdeci">uint32_t tMboxNotify(tMbox *mbox, void *msg, uint32_t notifyOption)</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8c_source.html#l00108">tMBox.c:108</a></div></div>
<div class="ttc" id="group___xE9_x82_xAE_xE7_xAE_xB1_html_gaf02fc8927d941b8983e485f054dee3c8"><div class="ttname"><a href="group___xE9_x82_xAE_xE7_xAE_xB1.html#gaf02fc8927d941b8983e485f054dee3c8">tMbox</a></div><div class="ttdeci">struct _tMbox tMbox</div></div>
<div class="ttc" id="t_event_8h_html"><div class="ttname"><a href="t_event_8h.html">tEvent.h</a></div></div>
<div class="ttc" id="struct__t_mbox_html_a1cc8a4ba5eee24b560f9869012941e91"><div class="ttname"><a href="struct__t_mbox.html#a1cc8a4ba5eee24b560f9869012941e91">_tMbox::maxCount</a></div><div class="ttdeci">uint32_t maxCount</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8h_source.html#l00033">tMBox.h:33</a></div></div>
<div class="ttc" id="struct__t_event_html"><div class="ttname"><a href="struct__t_event.html">_tEvent</a></div><div class="ttdef"><b>Definition:</b> <a href="t_event_8h_source.html#l00032">tEvent.h:32</a></div></div>
<div class="ttc" id="group___xE9_x82_xAE_xE7_xAE_xB1_html_gace85309e5c44e993e993af3a8e1b00c2"><div class="ttname"><a href="group___xE9_x82_xAE_xE7_xAE_xB1.html#gace85309e5c44e993e993af3a8e1b00c2">tMboxInfo</a></div><div class="ttdeci">struct _tMboxInfo tMboxInfo</div></div>
<div class="ttc" id="struct__t_mbox_html_a86988a65e0d3ece7990c032c159786d6"><div class="ttname"><a href="struct__t_mbox.html#a86988a65e0d3ece7990c032c159786d6">_tMbox::count</a></div><div class="ttdeci">uint32_t count</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8h_source.html#l00030">tMBox.h:30</a></div></div>
<div class="ttc" id="struct__t_mbox_info_html_a86988a65e0d3ece7990c032c159786d6"><div class="ttname"><a href="struct__t_mbox_info.html#a86988a65e0d3ece7990c032c159786d6">_tMboxInfo::count</a></div><div class="ttdeci">uint32_t count</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8h_source.html#l00040">tMBox.h:40</a></div></div>
<div class="ttc" id="group___xE9_x82_xAE_xE7_xAE_xB1_html_gaa37bb91261b5b19d6c7d72a88a52a457"><div class="ttname"><a href="group___xE9_x82_xAE_xE7_xAE_xB1.html#gaa37bb91261b5b19d6c7d72a88a52a457">tMboxFlush</a></div><div class="ttdeci">void tMboxFlush(tMbox *mbox)</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8c_source.html#l00154">tMBox.c:154</a></div></div>
<div class="ttc" id="struct__t_mbox_html_a42b4bab76140c12b77b72ec381001c6c"><div class="ttname"><a href="struct__t_mbox.html#a42b4bab76140c12b77b72ec381001c6c">_tMbox::msgBuffer</a></div><div class="ttdeci">void ** msgBuffer</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8h_source.html#l00035">tMBox.h:35</a></div></div>
<div class="ttc" id="struct__t_mbox_info_html"><div class="ttname"><a href="struct__t_mbox_info.html">_tMboxInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8h_source.html#l00039">tMBox.h:39</a></div></div>
<div class="ttc" id="group___xE9_x82_xAE_xE7_xAE_xB1_html_gae6bb5e2c3b40c25946cd3783387ef53e"><div class="ttname"><a href="group___xE9_x82_xAE_xE7_xAE_xB1.html#gae6bb5e2c3b40c25946cd3783387ef53e">tMboxInit</a></div><div class="ttdeci">void tMboxInit(tMbox *mbox, void **msgBuffer, uint32_t maxCount)</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8c_source.html#l00025">tMBox.c:25</a></div></div>
<div class="ttc" id="struct__t_mbox_html_a0a71cf941cf2509857d61e1443ad8eaa"><div class="ttname"><a href="struct__t_mbox.html#a0a71cf941cf2509857d61e1443ad8eaa">_tMbox::read</a></div><div class="ttdeci">uint32_t read</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8h_source.html#l00031">tMBox.h:31</a></div></div>
<div class="ttc" id="group___xE9_x82_xAE_xE7_xAE_xB1_html_ga3473c47a3e47521c023738edf046252f"><div class="ttname"><a href="group___xE9_x82_xAE_xE7_xAE_xB1.html#ga3473c47a3e47521c023738edf046252f">tMboxDestroy</a></div><div class="ttdeci">uint32_t tMboxDestroy(tMbox *mbox)</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8c_source.html#l00172">tMBox.c:172</a></div></div>
<div class="ttc" id="group___xE9_x82_xAE_xE7_xAE_xB1_html_ga23993f613e24cf58555aae3b7606722d"><div class="ttname"><a href="group___xE9_x82_xAE_xE7_xAE_xB1.html#ga23993f613e24cf58555aae3b7606722d">tMboxWait</a></div><div class="ttdeci">uint32_t tMboxWait(tMbox *mbox, void **msg, uint32_t waitTicks)</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8c_source.html#l00042">tMBox.c:42</a></div></div>
<div class="ttc" id="struct__t_mbox_html_ac4c9f9c5eac363cc22ecc18669cc3891"><div class="ttname"><a href="struct__t_mbox.html#ac4c9f9c5eac363cc22ecc18669cc3891">_tMbox::write</a></div><div class="ttdeci">uint32_t write</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8h_source.html#l00032">tMBox.h:32</a></div></div>
<div class="ttc" id="struct__t_mbox_html_a8b516ab130f86e4b15ca025c98c3dc53"><div class="ttname"><a href="struct__t_mbox.html#a8b516ab130f86e4b15ca025c98c3dc53">_tMbox::event</a></div><div class="ttdeci">tEvent event</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8h_source.html#l00028">tMBox.h:28</a></div></div>
<div class="ttc" id="group___xE9_x82_xAE_xE7_xAE_xB1_html_ga24727b25fe713d402f2f3aa21d6ea98b"><div class="ttname"><a href="group___xE9_x82_xAE_xE7_xAE_xB1.html#ga24727b25fe713d402f2f3aa21d6ea98b">tMboxNoWaitGet</a></div><div class="ttdeci">uint32_t tMboxNoWaitGet(tMbox *mbox, void **msg)</div><div class="ttdef"><b>Definition:</b> <a href="t_m_box_8c_source.html#l00079">tMBox.c:79</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="t_m_box_8h.html">tMBox.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
